home *** CD-ROM | disk | FTP | other *** search
- /* This file contains the launch utility for MiniTerm
-
- Jerry LeVan
- 325 Boone Trail
- Richmond Ky 40475
-
- May 1985
-
- */
- #include <types.h>
- #include <packages.h>
- #include <files.h>
-
- typedef struct LaunchStruct
- { char * fName; /* a pascal string (name of application) */
- long param; /* sound, video buffers to use */
- } LaunchStruct;
-
- pascal void Launch1(anApp)
- LaunchStruct *anApp; extern 0x205f; /* move.l (sp)+,a0 */
-
- pascal void Launch2() extern 0xa9f2; /* _Launch */
-
- #define Launch(whichOne) \
- Launch1(whichOne); Launch2()
-
- extern Boolean showClock;
-
- /********************************************************************/
- #define __SEG__ LaunchApp
- void LaunchAppl(port,asciiReceive,logfile,asciiSend,thefile)
- short port; /* which port we are using sPortA,sPortB */
- Boolean asciiReceive; /* true if we are capturing a file */
- short logfile; /* refnum of open receiving file */
- Boolean asciiSend; /* true if we are sending a file */
- short thefile; /* refnum of the file we are sending */
- {
- Point loc;
- SFTypeList typeList;
- SFReply reply;
- LaunchStruct Launch_Data;
-
- loc.v = 80;
- loc.h = 100;
-
- typeList[0] = 'APPL';
-
- SFGetFile(&loc, 0, 0, 1, typeList, 0, &reply);
-
- if( reply.good )
- {
- /* if the reply was good then we must set the default volume
- after closing open files and removing any vbl tasks */
-
- if(asciiReceive) FSClose(logfile);
-
- if (asciiSend) FSClose(thefile);
-
- if(showClock)stopClock();
-
- /* close the port */
- RAMSDClose(port);
-
- /* set default vol for launch */
- SetVol(nil,reply.vRefNum);
-
- /* launch the target application */
- Launch_Data.fName = &reply.fName;
- Launch_Data.param = 0; /* standard sound/video buffers */
-
- Launch(&Launch_Data); /* adios */
-
- }
- } /* LaunchAppl */
-
-